﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using SinaUI.Sevices;
using Sina.Altman.Weibo.Client.ViewModel;

namespace Sina.Altman.Weibo.Client
{
    public class VMLocator
    {
        private static VMLocator _instance;
        public static VMLocator Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = Application.Current.Resources["Locator"] as VMLocator;
                }
                return _instance;
            }
        }

        private INavigationService _currentNavigation;
        public INavigationService CurrentNavigation
        {
            get
            {
                if (_currentNavigation == null)
                {
                    _currentNavigation = new ApplicationFrameNavigationService((Application.Current as App).RootFrame);
                }
                return _currentNavigation;
            }
        }

        private PublicTimelineViewModel _publicTimelineVM;
        public PublicTimelineViewModel PublicTimelineVM
        {
            get { return _publicTimelineVM ?? (_publicTimelineVM = new PublicTimelineViewModel(CurrentNavigation)); }
        }

        private HomeViewModel _homeTimelineVM;
        public HomeViewModel HomeTimelineVM
        {
            get { return _homeTimelineVM ?? (_homeTimelineVM = new HomeViewModel(CurrentNavigation)); }
        }


    }
}
